<template>
<div>
  ShowInfo:{{name}}-{{age}}
</div>
  <button v-on:click="showInfoBtnClick">showInfoButton</button>
</template>

<script setup>
import {ref} from "vue";

const props=defineProps({
  name:{
    type:String,
    default:'默认值'
  },
  age:{
    type:Number,
    default:0
  }
})

const myName=ref('ding+')

const emits=defineEmits(['infoBtnClick'])

function showInfoBtnClick(){
  emits('infoBtnClick','showInfo内部发生了点击')
}

function foo(){
  console.log("foo function")
}

defineExpose({
  foo,
  myName
})

</script>

<style scoped>

</style>